import Taro, {Component} from '@tarojs/taro'
import {View, Text, Image} from '@tarojs/components'
import './index.scss'
import meGif from './me.gif';

export default class Index extends Component {

  config = {
    navigationBarTitleText: '首页'
  };

  constructor() {
    this.state = {
      flag: false,
    };
  }

  componentWillMount() {
  }

  componentDidMount() {
  }

  componentWillUnmount() {
  }

  componentDidShow() {
  }

  componentDidHide() {
  }

  render() {
    return (
      <View className='index'>
        <Text className="text">黎胖胖，猜猜我是谁？</Text>
        <Text className="btn" onClick={this.handleBtnClick}>
          {
            this.state.flag ? "爱你！！！！" : "我知道"
          }
        </Text>
        {
          this.state.flag && <Image className="img" src={meGif}></Image>
        }
      </View>
    )
  }

  handleBtnClick = ()=> {
    this.setState({flag: !this.state.flag});
  }
}
